{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
<div class="modal fade" id="action_properties_dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" {{action 'closeEditor'}}>
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">
          <span class="editor-icon-title">
          <i class="fa fa-{{icon}}"></i><span class="grayed">{{currentNode.name}}</span>
          </span>
          </h4>
      </div>
      <div class="modal-body">
        <div>
            <form class="form-horizontal" id="action_properties">
              {{designer-errors errors=errors validationErrors=validationErrors}}
              {{#if (eq nodeType 'decision')}}
                {{#decision-config currentNode=currentNode actionModel=actionModel killNodes=killNodes register="registerChild"}}{{/decision-config}}
              {{/if}}
              {{#if (eq nodeType 'action')}}
                {{#if containsUnsupportedProperties}}
                  <span class="unsupported-elt-warning"> <p><a href {{action "showUnsupportedProperties"}}><i class="fa fa-exclamation-triangle" aria-hidden="true"></i>Action contains elements that are not currently supported by the designer.</a></p></span>
                {{/if}}
                {{#if (eq actionType 'java')}}
                  {{#java-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/java-action}}
                {{else if (eq actionType 'hive')}}
                  {{#hive-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/hive-action}}
                {{else if (eq actionType 'sqoop')}}
                  {{#sqoop-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/sqoop-action}}
                {{else if (eq actionType 'pig')}}
                  {{#pig-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials credentials=credentials}}{{/pig-action}}
                {{else if (eq actionType 'shell')}}
                  {{#shell-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/shell-action}}
                {{else if (eq actionType 'spark')}}
                  {{#spark-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/spark-action}}
                {{else if (eq actionType 'hive2')}}
                  {{#hive2-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/hive2-action}}
                {{else if (eq actionType 'map-reduce')}}
                  {{#map-red-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/map-red-action}}
                {{else if (eq actionType 'distcp')}}
                  {{#distcp-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/distcp-action}}
                {{else if (eq actionType 'ssh')}}
                  {{#ssh-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/ssh-action}}
                {{else if (eq actionType 'email')}}
                  {{#email-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode}}{{/email-action}}
                {{else if (eq actionType 'fs')}}
                  {{#fs-action actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/fs-action}}
                {{else if (eq actionType 'sub-workflow')}}
                  {{#sub-workflow actionModel=actionModel transition=transition killNodes=killNodes openFileBrowser="openFileBrowser" register="registerChild" addKillNode="addKillNode" currentNode=currentNode credentials=credentials}}{{/sub-workflow}}
                {{else}}
                    <div class="panel panel-default">
                      <div class="panel-heading">Action XML</div>
                      <div class="panel-body handlerPanel">
                        <div class="alert alert-info alert-dismissible" role="alert">
                          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                           Action extension should be configured in Oozie for the custom action to work.
                        </div>
                        {{designer-errors errors=errors}}
                        {{textarea class="custom-action-xml" value=actionXml}}
                      </div>
                    </div>
                    <div class="panel panel-default">
                      <div class="panel-heading">Transition</div>
                      <div class="panel-body handlerPanel">
                        {{#transition-config transition=transition killNodes=killNodes currentNode=currentNode}}{{/transition-config}}
                      </div>
                    </div>
                    {{#action-credential-config credentials=credentials actionCredentials=actionModel.credentials}}{{/action-credential-config}}
                    {{#sla-info slaInfo=customSlaInfo slaEnabled=customSlaEnabled}}{{/sla-info}}
              {{/if}}
              {{#if containsUnsupportedProperties}}
                <div id="unsupported-props" class=" panel panel-default">
                  <div class="panel-heading">Unsupported Properties</div>
                  <div class="panel-body handlerPanel">
                    {{textarea class="unsupported-xml" value=unsupportedPropertiesXml}}
                  </div>
                </div>
              {{/if}}
              {{/if}}
              {{#if (eq nodeType 'kill')}}
                <div class="form-group">
                  <label class="control-label col-xs-2"> Kill message</label>
                  <div class=" col-xs-7">
                    {{textarea class="form-control" rows="5" placeholder="kill node message" name="kill-node-message" value=currentNode.killMessage}}
                  </div>
                </div>
              {{/if}}
          </form>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" {{action 'closeEditor'}}>Cancel</button>
        <button type="button" class="btn btn-primary" {{action 'save'}}>Save</button>
      </div>
    </div>
  </div>
</div>
{{#if showingFileBrowser}}
  {{hdfs-browser closeFileBrowser="closeFileBrowser" selectFileCallback=selectFileCallback filePath=filePath}}
{{/if}}
